using JUtil.Web.Extensions;
using JUtil.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections.Specialized;
using JUtil;
using System.Reflection;
using NAMESPACE;

namespace NAMESPACE
{
	public partial class GGG 
		: XPage
		, IMasterView
	{
		protected void BtnQuery_Click(object sender, EventArgs e)
		{
			// 將頁數設定為第一頁(PageIndex=0)
			grvMaster.PageIndex = 0;

			QueryMaster();
		}

		#region IMasterView 成員

		void IMasterView.SetSelectParameters()
		{
			// 清空原先的查詢條件
			MasterBLL.SelectParameters.Clear();

			// 重設查詢條件
			MasterBLL.SelectParameters["隨便設定"] = "隨便設定";
		}

		void IMasterView.DoDataBind()
		{
			grvMaster.SelectedIndex = -1;

			grvMaster.DataBind();
		}

		object IMasterView.GetUI()
		{
			return grvMaster;
		}

		object IMasterView.GetDataSource()
		{
			return dsMaster;
		}

		Type IMasterView.GetDalType()
		{
			return typeof(DAL_CLASS);
		}

		object IMasterView.BLL
		{
			get { return MasterBLL; }
		}

		private BLL_CLASS _MasterBLL;
		private BLL_CLASS MasterBLL
		{
			get
			{
				_MasterBLL = _MasterBLL ?? new BLL_CLASS();

				return _MasterBLL;
			}
		}

		#endregion
	}
}
